<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:			EmployeeList.jsp
  //	TITLE:			Employee Information List
  //	FUNCTION:			List the Searching result.
  //	BY:				Beyes Xia
  //	DATE:			2004-1-13 16:10
  // --------------------------------------------------------------
-->

<html>
<%@ include file="../tssheader.jsp" %>
<%@ page import="tss.employee.*" %>
<%
	Vector employees = new Vector();
	employees = (Vector)request.getAttribute("employees");
	
            String staffName = "";
            String position = "";
            String joinDateFrom = "";
            String joinDateTo = "";
            String department = "";
            String costCenter = "";
            String employeeType = "";
            
            if(request.getParameter("staff_name") != null && request.getParameter("staff_name").length()!=0)
                staffName = request.getParameter("staff_name");
            if(request.getParameter("position") != null && request.getParameter("position").length()!=0)
                position = request.getParameter("position");
            if(request.getParameter("join_date_from") != null && request.getParameter("join_date_from").length()!=0)
                joinDateFrom = request.getParameter("join_date_from");
            if(request.getParameter("join_date_to") != null && request.getParameter("join_date_to").length()!=0)
                joinDateTo = request.getParameter("join_date_to");               
            if(request.getParameter("department") != null && request.getParameter("department").length()!=0)
                department = request.getParameter("department");
            if(request.getParameter("cost_center") != null && request.getParameter("cost_center").length()!=0)
                costCenter = request.getParameter("cost_center");
            if(request.getParameter("employee_type") != null && request.getParameter("employee_type").length()!=0)
                employeeType = request.getParameter("employee_type"); 
%>
<body >
<h2>Employee Information</h2>

<table>
<% if(staffName!=null && staffName.length()!=0) { %>
<tr>
	<td>Staff No.:</td>
	<td><%=staffName%></td>
</tr>
<% } %>
<% if(position!=null && position.length()!=0) { %>
<tr>
	<td>Position:</td>
	<td><%=position%></td>
</tr>
<% } %>
<% if(joinDateFrom!=null && joinDateFrom.length()!=0) { %>
<tr>
	<td>Join Date From:</td>
	<td><%=joinDateFrom%></td>
</tr>
<% } %>
<% if(joinDateTo!=null && joinDateTo.length()!=0) { %>
<tr>
	<td>Join Date To:</td>
	<td><%=joinDateTo%></td>
</tr>
<% } %>
<% if(department!=null && department.length()!=0) { %>
<tr>
	<td>Department:</td>
	<td><%=department%></td>
</tr>
<% } %>
<% if(costCenter!=null && costCenter.length()!=0) { %>
<tr>
	<td>Cost Center:</td>
	<td><%=costCenter%></td>
</tr>
<% } %>
<% if(employeeType!=null && employeeType.length()!=0) { %>
<tr>
	<td>Employee Type:</td>
	<td><%=employeeType%></td>
</tr>
<% } %>
</table>

<table cols=9 border=1 >
<thead>
  <td nowrap><b>Staff No.</b></td>
  <td nowrap><b>English Name</b></td>
  <td nowrap><b>Chinese Name</b></td>
  <td nowrap><b>Join Date</b></td>
  <td nowrap><b>Last Date</b></td>
  <td nowrap><b>Department</b></td>
  <td nowrap><b>Cost Center</b></td>
  <td nowrap><b>Position</b></td>
  <td nowrap><b>Employee Type</b></td>
</thead>
<%  for (int i=0; i<employees.size(); i++)
    {
    		String[] employeeValue = new String[11];
    		employeeValue = (String[])employees.get(i); 		
%>
<tr>
    <td nowrap><a href="<%=contextPath%>/servlet/tss.employee.EmployeeSearch?staff_name=<%=employeeValue[0]%>"><%=employeeValue[0]%></a></td>
    <td nowrap><%=employeeValue[3]+" "+employeeValue[1]%></td>
    <td nowrap><%=employeeValue[1]+" "+employeeValue[2]%></td>
    <td nowrap><%=employeeValue[4]%></td>
    <td nowrap><%=employeeValue[5]==null?"&nbsp":employeeValue[5]%></td>
    <td nowrap><%=employeeValue[6]%></td>
    <td nowrap><%=employeeValue[7]%></td>
    <td nowrap><%=employeeValue[8]%></td>
    <td nowrap><%=employeeValue[9]%></td>
</tr>
<%  } %>
</table>
<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href= '<%=contextPath%>/tss/employee/EmployeeSearch.jsp'">
</p>
</body>
<%@ include file="../tssfooter.jsp" %>
</body>
</html>

